<div class="purchases form">
    <div class="actions specific">
        <ul>
            <li><?php echo $this->Html->link(__('Eliminar', true), array('action' => 'delete', $this->Form->value('Purchase.id')), null, sprintf(__('Esta seguro que desea eliminar la compra # %s?', true), date('m/d/Y', strtotime($this->Form->value('Purchase.purchase_date'))))); ?></li>
        </ul>
    </div>
    <?php echo $this->Form->create('Purchase'); ?>
    <fieldset>
        <legend><?php __('Editar Compra'); ?></legend>
        <?php
        echo $this->Form->input('id', array('label' => 'Id'));
        echo $this->Form->input('purchase_date', array('label' => 'Fecha de Compra', 'type' => 'text'));
        echo $this->Form->input('purchase_amount', array('label' => 'Cantidad'));
        echo $this->Form->input('article_id', array('label' => 'Artículo', 'disabled' =>"disabled"));
        echo $this->Form->input('supplier_id', array('label' => 'Proveedor'));
        if($this->data['Purchase']['order_id'] == NULL){
            echo $this->Form->input('order_id', array('label' => 'Pedido', 'type' => 'text', 'placeholder' => 'Carga Inicial','readonly' => 'readonly'));
        }else{
//            $fecha = date('d/m/Y', strtotime($this->data['Order']['date']));
//            echo $this->Form->input($fecha, array('label' => 'Pedido','type' =>'text', 'readonly' => 'readonly'));
            echo $this->Form->input('order_id', array('label' => 'Pedido', 'readonly' =>"readonly"));
        }
        ?>
    </fieldset>
    <?php echo $this->Form->end(__('Guardar', true)); ?>
</div>
<script type="text/javascript">
    (function($){
        // Date picker
        $("#PurchasePurchaseDate").datepicker({
            //yearRange: '1970:2010',
            defaultDate: new Date(),
            dateFormat: 'dd/mm/yy',
            changeMonth: true,
            changeYear: true
        });
        
        //toda la documentacion de esta librería la encontras aca
        //http://jqueryui.com/demos/datepicker/
    })(jQuery);
</script>
<!--<script type="text/javascript">
    (function($){
        // Date picker
        $("#PurchaseOrderId").datepicker({
            //yearRange: '1970:2010',
            defaultDate: new Date(),
            dateFormat: 'dd/mm/yy',
            changeMonth: true,
            changeYear: true
        });
        
        //toda la documentacion de esta librería la encontras aca
        //http://jqueryui.com/demos/datepicker/
    })(jQuery);
</script>-->